<?php
// 配置键定义
$configKey = isset($configKey) ? $configKey : 'ui_ux_design';

// UI/UX设计服务默认配置
$designConfig = [
    'section_id' => 'ui-ux-design',
    'section_pretitle' => '用户体验',
    'section_title' => 'UI/UX设计服务',
    'section_subtitle' => '通过人性化设计创造卓越用户体验，提升产品价值与用户忠诚度',
    'bg_color' => 'gray-50',
    'card_style' => 'modern', // modern, classic, minimal
    'texts' => [
        'process_title' => '我们的设计流程',
        'process_subtitle' => '系统化的设计方法确保每个项目都能创造出真正满足用户需求的产品体验',
        'philosophy_title' => '我们的设计理念',
        'philosophy_subtitle' => '指导我们创造卓越用户体验的核心原则',
        'case_studies_title' => '设计成功案例',
        'case_studies_subtitle' => '我们通过精心设计帮助各行业客户提升产品体验与业务成果',
        'pricing_title' => '设计服务定价',
        'pricing_subtitle' => '灵活的设计方案满足不同规模项目需求，确保优质设计体验',
        'pricing_custom_note' => '需要定制化设计服务？<a href="#design-form" class="text-purple-600 hover:underline font-medium">联系我们</a>获取专属方案',
        'case_studies_more' => '浏览更多案例',
        'form_required_mark' => '*',
        'form_company_placeholder' => '请输入您的公司名称',
        'form_name_placeholder' => '请输入您的姓名',
        'form_phone_placeholder' => '请输入您的联系电话',
        'form_email_placeholder' => '请输入您的电子邮箱',
        'form_select_default' => '请选择您的主要需求',
        'form_product_placeholder' => '请简要描述您的产品类型、目标用户及当前面临的设计挑战...',
        'form_submit_success' => '您的申请已提交成功！我们的设计专家将在24小时内与您联系，提供专业的设计评估。'
    ],
    'services' => [
        [
            'id' => 'ux-research',
            'title' => '用户体验研究',
            'description' => '深入理解用户需求与行为，为设计决策提供数据支持',
            'icon' => 'fa-search',
            'accent_color' => 'blue-600',
            'features' => [
                '用户画像构建',
                '用户旅程地图',
                '可用性测试',
                '竞品分析',
                '用户访谈与问卷'
            ],
            'results' => [
                '用户需求识别' => '98%',
                '痛点发现' => '100%',
                '决策支持' => '95%'
            ],
            'case_study' => '某金融APP通过用户研究，发现3个关键痛点，用户留存提升27%'
        ],
        [
            'id' => 'ui-design',
            'title' => '界面视觉设计',
            'description' => '打造美观且功能清晰的界面，提升品牌识别度与用户体验',
            'icon' => 'fa-paint-brush',
            'accent_color' => 'purple-600',
            'features' => [
                '品牌视觉统一',
                '响应式界面设计',
                '交互原型制作',
                '设计系统构建',
                'UI组件库开发'
            ],
            'results' => [
                '视觉一致性' => '100%',
                '开发效率提升' => '40%',
                '用户满意度' => '92%'
            ],
            'case_study' => '为电商平台重构界面，视觉转化率提升35%，品牌识别度提高58%'
        ],
        [
            'id' => 'ux-design',
            'title' => '用户体验设计',
            'description' => '优化用户流程与交互逻辑，创造流畅直观的产品体验',
            'icon' => 'fa-sitemap',
            'accent_color' => 'green-600',
            'features' => [
                '信息架构设计',
                '用户流程图',
                '线框图制作',
                '交互设计规范',
                'A/B测试优化'
            ],
            'results' => [
                '操作步骤减少' => '35%',
                '任务完成率' => '98%',
                '用户停留时间' => '+67%'
            ],
            'case_study' => '企业SaaS产品体验优化后，用户任务完成时间缩短42%，支持请求减少53%'
        ],
        [
            'id' => 'prototyping',
            'title' => '交互原型开发',
            'description' => '构建高保真可交互原型，验证设计方案并加速产品迭代',
            'icon' => 'fa-cube',
            'accent_color' => 'orange-600',
            'features' => [
                '高保真原型制作',
                '交互动效设计',
                '用户测试原型',
                '原型导出与交付',
                '协作评审工具'
            ],
            'results' => [
                '开发返工减少' => '65%',
                '测试效率提升' => '70%',
                '团队协作效率' => '+50%'
            ],
            'case_study' => '为初创公司制作交互原型，早期用户测试反馈提升产品方向，节省开发成本40%'
        ]
    ],
    'process' => [
        [
            'step' => 1,
            'title' => '需求洞察',
            'description' => '深入理解业务目标与用户需求，明确设计方向与成功指标'
        ],
        [
            'step' => 2,
            'title' => '策略规划',
            'description' => '基于研究结果制定设计策略，规划信息架构与用户流程'
        ],
        [
            'step' => 3,
            'title' => '设计迭代',
            'description' => '创建原型并通过用户测试持续优化，确保设计方案的有效性'
        ],
        [
            'step' => 4,
            'title' => '交付落地',
            'description' => '提供完整设计规范与资源，支持开发实现并进行上线后评估'
        ]
    ],
    'case_studies' => [
        [
            'id' => 'finance-app',
            'title' => '金融APP用户体验重构',
            'industry' => '金融科技',
            'challenge' => '复杂的操作流程导致用户流失率高，功能使用率低',
            'solution' => '全面的用户研究结合简化的交互设计，重新构建信息架构',
            'results' => [
                '用户留存提升32%',
                '核心功能使用率增加87%',
                '用户满意度提升至4.8/5分'
            ],
            'image' => 'https://picsum.photos/seed/financeapp/800/500',
            'image_alt' => '金融APP设计前后对比'
        ],
        [
            'id' => 'ecommerce-redesign',
            'title' => '电商平台视觉与体验升级',
            'industry' => '电子商务',
            'challenge' => '老旧界面导致转化率低，移动端体验不佳',
            'solution' => '品牌视觉重塑与全渠道响应式设计，优化购买流程',
            'results' => [
                '移动端转化率提升53%',
                '平均订单价值增加28%',
                '页面加载速度提升47%'
            ],
            'image' => 'https://picsum.photos/seed/ecomdesign/800/500',
            'image_alt' => '电商平台设计案例展示'
        ]
    ],
    'pricing' => [
        [
            'id' => 'basic',
            'title' => '基础设计包',
            'subtitle' => '适合小型项目与MVP开发',
            'price' => 15800,
            'period' => '项目',
            'features' => [
                '最多5个页面设计',
                '基础用户研究',
                '低保真原型',
                '设计规范文档',
                '1轮修改迭代'
            ],
            'recommended' => false,
            'button_text' => '选择此方案'
        ],
        [
            'id' => 'standard',
            'title' => '标准设计包',
            'subtitle' => '适合中小型产品完整设计',
            'price' => 36800,
            'period' => '项目',
            'features' => [
                '最多15个页面设计',
                '全面用户研究',
                '高保真交互原型',
                '完整设计系统',
                '3轮修改迭代',
                '开发支持',
                '上线后评估'
            ],
            'recommended' => true,
            'button_text' => '选择此方案'
        ],
        [
            'id' => 'enterprise',
            'title' => '企业定制包',
            'subtitle' => '适合大型复杂产品与长期合作',
            'price' => 88000,
            'period' => '起',
            'features' => [
                '无限页面设计',
                '深度用户研究与测试',
                '全交互原型与动效',
                '定制设计系统开发',
                '无限修改迭代',
                '专属设计团队',
                '长期产品优化支持',
                '多平台适配'
            ],
            'recommended' => false,
            'button_text' => '选择此方案'
        ]
    ],
    'design_philosophy' => [
        [
            'title' => '以用户为中心',
            'description' => '所有设计决策基于深入的用户洞察，确保产品真正满足用户需求',
            'icon' => 'fa-users'
        ],
        [
            'title' => '美学与功能平衡',
            'description' => '在追求视觉吸引力的同时，始终优先考虑功能完整性与易用性',
            'icon' => 'fa-balance-scale'
        ],
        [
            'title' => '数据驱动优化',
            'description' => '通过用户行为数据持续优化设计，而非依赖主观判断',
            'icon' => 'fa-bar-chart'
        ],
        [
            'title' => '可扩展性设计',
            'description' => '构建灵活的设计系统，支持产品未来迭代与功能扩展',
            'icon' => 'fa-code-fork'
        ]
    ],
    'cta' => [
        'title' => '准备好提升您的产品体验了吗？',
        'subtitle' => '免费获取产品设计评估与优化建议，发现提升空间',
        'button_text' => '获取设计评估',
        'form_action' => '/submit-design.php',
        'form_id' => 'designForm',
        'form_elements' => [
            [
                'name' => 'company',
                'label' => '公司名称',
                'type' => 'text',
                'required' => true,
                'placeholder' => '请输入您的公司名称'
            ],
            [
                'name' => 'contact_name',
                'label' => '联系人姓名',
                'type' => 'text',
                'required' => true,
                'placeholder' => '请输入您的姓名'
            ],
            [
                'name' => 'phone',
                'label' => '联系电话',
                'type' => 'tel',
                'required' => true,
                'placeholder' => '请输入您的联系电话'
            ],
            [
                'name' => 'email',
                'label' => '电子邮箱',
                'type' => 'email',
                'required' => true,
                'placeholder' => '请输入您的电子邮箱'
            ],
            [
                'name' => 'design_needs',
                'label' => '您的设计需求',
                'type' => 'select',
                'required' => true,
                'options' => [
                    '' => '请选择您的主要需求',
                    'full-design' => '完整产品设计',
                    'redesign' => '现有产品改版'
                ]
            ],
            [
                'name' => 'product_info',
                'label' => '产品信息',
                'type' => 'textarea',
                'required' => false,
                'rows' => 4,
                'placeholder' => '请简要描述您的产品类型、目标用户及当前面临的设计挑战...'
            ]
        ],
        'features' => [
            [
                'title' => '专业评估',
                'description' => '基于行业最佳实践的产品设计全面评估',
                'icon' => 'fa-search'
            ],
            [
                'title' => '改进建议',
                'description' => '针对性的设计优化方案与实施路径',
                'icon' => 'fa-lightbulb-o'
            ],
            [
                'title' => '价值预估',
                'description' => '设计改进可能带来的用户体验与业务提升',
                'icon' => 'fa-rocket'
            ]
        ]
    ],
    // 样式类配置
    'classes' => [
        // 全局样式
        'section_container' => 'py-16',
        'container' => 'mx-auto px-4 sm:px-6 lg:px-8',

        // 标题样式
        'section_pretitle' => 'inline-block text-sm font-semibold text-purple-600 uppercase tracking-wider mb-2',
        'section_title' => 'text-3xl md:text-4xl font-bold text-gray-900 mb-4',
        'section_subtitle' => 'text-lg text-gray-600',
        'card_title' => 'text-xl font-semibold mb-3 text-gray-900',
        'card_subtitle' => 'text-gray-600 mb-6',

        // 卡片样式
        'card_base' => 'p-8 rounded-xl transition-all duration-300 h-full',
        'card_modern' => 'shadow-md hover:shadow-xl hover:-translate-y-1',
        'card_classic' => 'border border-gray-200 hover:border-primary',
        'card_minimal' => '',
        'card_featured' => 'border-2 border-purple-500 scale-105 z-10',

        // 服务卡片样式
        'service_icon_container' => 'w-16 h-16 rounded-lg flex items-center justify-center mb-6 text-2xl transition-transform duration-500',
        'service_features' => 'space-y-2 mb-6',
        'service_feature_item' => 'flex items-center text-sm text-gray-700',
        'service_feature_icon' => 'fa fa-check mr-2',
        'service_results' => 'p-4 rounded-lg border border-gray-200 mb-6',
        'service_results_title' => 'text-sm font-medium text-gray-900 mb-3',
        'service_results_grid' => 'grid grid-cols-2 gap-3',
        'service_results_metric' => 'text-xs text-gray-500',
        'service_results_value' => 'text-lg font-bold',
        'service_case_study' => 'text-sm text-gray-700 italic',

        // 流程样式
        'process_container' => 'relative',
        'process_line' => 'hidden md:block absolute top-1/2 left-0 right-0 h-1 bg-gray-200 -translate-y-1/2 z-0',
        'process_grid' => 'grid grid-cols-1 md:grid-cols-4 gap-8 relative z-10',
        'process_step' => 'flex flex-col items-center text-center',
        'process_step_number' => 'w-16 h-16 rounded-full text-purple-600 flex items-center justify-center text-2xl font-bold mb-4 border-2 border-purple-100 shadow-sm',
        'process_step_title' => 'text-xl font-semibold mb-2 text-gray-900',
        'process_step_desc' => 'text-gray-600',

        // 设计理念样式
        'philosophy_grid' => 'grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8',
        'philosophy_card' => 'p-8 rounded-xl shadow-sm hover:shadow-md transition-all duration-300 border border-gray-100',
        'philosophy_icon' => 'w-14 h-14 text-purple-600 rounded-lg flex items-center justify-center mb-6 text-2xl border-2 border-purple-100',

        // 案例研究样式
        'case_studies_grid' => 'grid grid-cols-1 lg:grid-cols-2 gap-8',
        'case_card' => 'rounded-xl shadow-sm overflow-hidden hover:shadow-md transition-all duration-300 border border-gray-100',
        'case_image' => 'h-48 w-full object-cover lg:h-full lg:w-full',
        'case_content' => 'p-8 lg:w-1/2',
        'case_industry' => 'text-sm font-semibold text-purple-600 mb-2',
        'case_title' => 'text-2xl font-bold text-gray-900 mb-3',
        'case_section_title' => 'text-sm font-semibold text-gray-900 mb-1',
        'case_section_content' => 'text-gray-600 text-sm',
        'case_results' => 'text-sm text-gray-700 space-y-1',
        'case_result_item' => 'flex items-center',
        'case_result_icon' => 'fa fa-arrow-up text-green-500 mr-2',
        'case_link' => 'inline-flex items-center text-purple-600 hover:text-purple-800 font-medium mt-6',
        'case_link_icon' => 'fa fa-long-arrow-right ml-2',
        'case_more_button' => 'inline-flex items-center px-6 py-3 border border-transparent text-base font-medium rounded-md text-white bg-purple-600 hover:bg-purple-700 transition-colors duration-300 mt-10',
        'case_more_icon' => 'fa fa-chevron-right ml-2',

        // 定价样式
        'pricing_grid' => 'grid grid-cols-1 md:grid-cols-3 gap-8',
        'pricing_card' => 'relative',
        'pricing_recommended_badge' => 'absolute top-0 right-0 bg-purple-500 text-white text-xs font-bold px-3 py-1 rounded-bl-lg',
        'pricing_price' => 'text-4xl font-bold text-gray-900',
        'pricing_period' => 'text-gray-600 ml-1',
        'pricing_features' => 'space-y-3 mb-8',
        'pricing_feature_item' => 'flex items-start',
        'pricing_feature_icon' => 'fa fa-check text-green-500 mt-1 mr-3',
        'pricing_feature_text' => 'text-gray-700',
        'pricing_button' => 'block w-full py-3 px-4 font-medium rounded-lg transition-all duration-300 text-center',
        'pricing_button_standard' => 'border-2 border-gray-800 text-gray-800 hover:bg-gray-50',
        'pricing_button_recommended' => 'border-2 border-purple-600 text-purple-600 hover:bg-purple-50',
        'pricing_note' => 'text-center mt-10 text-gray-600',

        // CTA表单样式
        'cta_container' => 'max-w-4xl mx-auto border-2 border-gray-200 rounded-2xl overflow-hidden',
        'cta_grid' => 'grid grid-cols-1 lg:grid-cols-2',
        'cta_info' => 'p-8 lg:p-12 border-2 border-purple-500 text-purple-700',
        'cta_info_title' => 'text-3xl font-bold mb-4',
        'cta_info_subtitle' => 'mb-8 opacity-90',
        'cta_features' => 'space-y-6',
        'cta_feature_item' => 'flex items-start',
        'cta_feature_icon' => 'flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center border-2 border-purple-300',
        'cta_feature_content' => 'ml-4',
        'cta_feature_title' => 'font-semibold mb-1',
        'cta_feature_desc' => 'text-sm opacity-80',
        'cta_form_container' => 'p-8 lg:p-12',
        'cta_form' => 'space-y-6',
        'form_group' => '',
        'form_label' => 'block text-gray-700 font-medium mb-2',
        'form_required' => 'text-red-500',
        'form_control' => 'w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent transition-all duration-300',
        'form_select' => 'w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent transition-all duration-300',
        'form_textarea' => 'w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent transition-all duration-300',
        'form_submit' => 'w-full py-3 px-4 bg-purple-600 hover:bg-purple-700 text-white font-medium rounded-lg transition-all duration-300 shadow hover:shadow-md focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2',
        'form_submit_loading' => 'fa fa-spinner fa-spin mr-2',
        'form_submit_text' => ''
    ]
];

// 合并配置（优先级：页面配置 > 默认配置）
$data = array_merge($designConfig, $pageConfig['components'][$configKey] ?? []);

// 处理背景样式
$bgClass = "bg-{$data['bg_color']}";

// 处理卡片样式映射
$cardStyleMap = [
    'modern' => $data['classes']['card_modern'],
    'classic' => $data['classes']['card_classic'],
    'minimal' => $data['classes']['card_minimal']
];

// 组合基础卡片样式和选中的卡片样式
$cardClass = $data['classes']['card_base'] . ' ' . ($cardStyleMap[$data['card_style']] ?? $cardStyleMap['modern']);

// 为设计需求选择框添加服务选项
foreach ($data['services'] as $service) {
    $data['cta']['form_elements'][4]['options'][$service['id']] = $service['title'];
}
?>

<!-- UI/UX设计服务页面 -->
<section id="<?php echo htmlspecialchars($data['section_id']); ?>" class="<?php echo $bgClass; ?> <?php echo $data['classes']['section_container']; ?>">
    <div class="<?php echo $data['classes']['container']; ?>">
        <!-- 区域标题 -->
        <div class="text_center max_w_3xl mx-auto mb_16">
            <span class="<?php echo $data['classes']['section_pretitle']; ?>">
                <?php echo htmlspecialchars($data['texts']['section_pretitle']); ?>
            </span>

            <h2 class="<?php echo $data['classes']['section_title']; ?>">
                <?php echo htmlspecialchars($data['texts']['section_title']); ?>
            </h2>

            <p class="<?php echo $data['classes']['section_subtitle']; ?>">
                <?php echo htmlspecialchars($data['texts']['section_subtitle']); ?>
            </p>
        </div>

        <!-- 设计服务类型 -->
        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8 mb_20">
            <?php foreach ($data['services'] as $service): ?>
                <div class="<?php echo $cardClass; ?> group" data-service-card>
                    <!-- 图标容器 -->
                    <div class="<?php echo $data['classes']['service_icon_container']; ?> bg-<?php echo $service['accent_color']; ?>/10 text-<?php echo $service['accent_color']; ?> group-hover:scale-110">
                        <i class="fa <?php echo htmlspecialchars($service['icon']); ?>"></i>
                    </div>

                    <!-- 服务信息 -->
                    <h3 class="<?php echo $data['classes']['card_title']; ?> group-hover:text-<?php echo $service['accent_color']; ?> transition-colors duration-300">
                        <?php echo htmlspecialchars($service['title']); ?>
                    </h3>

                    <p class="<?php echo $data['classes']['card_subtitle']; ?>">
                        <?php echo htmlspecialchars($service['description']); ?>
                    </p>

                    <!-- 服务特点 -->
                    <ul class="<?php echo $data['classes']['service_features']; ?>">
                        <?php foreach ($service['features'] as $feature): ?>
                            <li class="<?php echo $data['classes']['service_feature_item']; ?>">
                                <i class="<?php echo $data['classes']['service_feature_icon']; ?> text-<?php echo $service['accent_color']; ?>"></i>
                                <?php echo htmlspecialchars($feature); ?>
                            </li>
                        <?php endforeach; ?>
                    </ul>

                    <!-- 服务成果 -->
                    <div class="<?php echo $data['classes']['service_results']; ?>">
                        <h4 class="<?php echo $data['classes']['service_results_title']; ?>">典型成果</h4>
                        <div class="<?php echo $data['classes']['service_results_grid']; ?>">
                            <?php foreach ($service['results'] as $metric => $value): ?>
                                <div>
                                    <div class="<?php echo $data['classes']['service_results_metric']; ?>"><?php echo htmlspecialchars($metric); ?></div>
                                    <div class="<?php echo $data['classes']['service_results_value']; ?> text-<?php echo $service['accent_color']; ?>"><?php echo htmlspecialchars($value); ?></div>
                                </div>
                            <?php endforeach; ?>
                        </div>
                    </div>

                    <!-- 案例简述 -->
                    <p class="<?php echo $data['classes']['service_case_study']; ?>">
                        "<?php echo htmlspecialchars($service['case_study']); ?>"
                    </p>
                </div>
            <?php endforeach; ?>
        </div>

        <!-- 设计流程 -->
        <div class="max_w_5xl mx-auto mb_20">
            <div class="text_center mb_16">
                <h2 class="<?php echo $data['classes']['section_title']; ?>">
                    <?php echo htmlspecialchars($data['texts']['process_title']); ?>
                </h2>
                <p class="<?php echo $data['classes']['section_subtitle']; ?> max_w_3xl mx-auto">
                    <?php echo htmlspecialchars($data['texts']['process_subtitle']); ?>
                </p>
            </div>

            <div class="<?php echo $data['classes']['process_container']; ?>">
                <!-- 连接线 -->
                <div class="<?php echo $data['classes']['process_line']; ?>"></div>

                <div class="<?php echo $data['classes']['process_grid']; ?>">
                    <?php foreach ($data['process'] as $step): ?>
                        <div class="<?php echo $data['classes']['process_step']; ?>">
                            <div class="<?php echo $data['classes']['process_step_number']; ?>">
                                <?php echo $step['step']; ?>
                            </div>
                            <h3 class="<?php echo $data['classes']['process_step_title']; ?>">
                                <?php echo htmlspecialchars($step['title']); ?>
                            </h3>
                            <p class="<?php echo $data['classes']['process_step_desc']; ?>">
                                <?php echo htmlspecialchars($step['description']); ?>
                            </p>
                        </div>
                    <?php endforeach; ?>
                </div>
            </div>
        </div>

        <!-- 设计理念 -->
        <div class="max_w_5xl mx-auto mb_20">
            <div class="text_center mb_16">
                <h2 class="<?php echo $data['classes']['section_title']; ?>">
                    <?php echo htmlspecialchars($data['texts']['philosophy_title']); ?>
                </h2>
                <p class="<?php echo $data['classes']['section_subtitle']; ?> max_w_3xl mx-auto">
                    <?php echo htmlspecialchars($data['texts']['philosophy_subtitle']); ?>
                </p>
            </div>

            <div class="<?php echo $data['classes']['philosophy_grid']; ?>">
                <?php foreach ($data['design_philosophy'] as $item): ?>
                    <div class="<?php echo $data['classes']['philosophy_card']; ?>">
                        <div class="<?php echo $data['classes']['philosophy_icon']; ?>">
                            <i class="fa <?php echo htmlspecialchars($item['icon']); ?>"></i>
                        </div>
                        <h3 class="<?php echo $data['classes']['card_title']; ?>">
                            <?php echo htmlspecialchars($item['title']); ?>
                        </h3>
                        <p class="<?php echo $data['classes']['card_subtitle']; ?>">
                            <?php echo htmlspecialchars($item['description']); ?>
                        </p>
                    </div>
                <?php endforeach; ?>
            </div>
        </div>

        <!-- 成功案例 -->
        <div class="max_w_6xl mx-auto mb_20">
            <div class="text_center mb_16">
                <h2 class="<?php echo $data['classes']['section_title']; ?>">
                    <?php echo htmlspecialchars($data['texts']['case_studies_title']); ?>
                </h2>
                <p class="<?php echo $data['classes']['section_subtitle']; ?> max_w_3xl mx-auto">
                    <?php echo htmlspecialchars($data['texts']['case_studies_subtitle']); ?>
                </p>
            </div>

            <div class="<?php echo $data['classes']['case_studies_grid']; ?>">
                <?php foreach ($data['case_studies'] as $case): ?>
                    <div class="<?php echo $data['classes']['case_card']; ?>">
                        <div class="lg:flex">
                            <div class="lg:shrink-0 lg:w-1/2">
                                <img
                                    class="<?php echo $data['classes']['case_image']; ?>"
                                    src="<?php echo htmlspecialchars($case['image']); ?>"
                                    alt="<?php echo htmlspecialchars($case['image_alt']); ?>">
                            </div>
                            <div class="<?php echo $data['classes']['case_content']; ?>">
                                <div class="<?php echo $data['classes']['case_industry']; ?>">
                                    <?php echo htmlspecialchars($case['industry']); ?>
                                </div>
                                <h3 class="<?php echo $data['classes']['case_title']; ?>">
                                    <?php echo htmlspecialchars($case['title']); ?>
                                </h3>

                                <div class="mb-4">
                                    <h4 class="<?php echo $data['classes']['case_section_title']; ?>">挑战</h4>
                                    <p class="<?php echo $data['classes']['case_section_content']; ?>">
                                        <?php echo htmlspecialchars($case['challenge']); ?>
                                    </p>
                                </div>

                                <div class="mb-4">
                                    <h4 class="<?php echo $data['classes']['case_section_title']; ?>">解决方案</h4>
                                    <p class="<?php echo $data['classes']['case_section_content']; ?>">
                                        <?php echo htmlspecialchars($case['solution']); ?>
                                    </p>
                                </div>

                                <div>
                                    <h4 class="<?php echo $data['classes']['case_section_title']; ?>">成果</h4>
                                    <ul class="<?php echo $data['classes']['case_results']; ?>">
                                        <?php foreach ($case['results'] as $result): ?>
                                            <li class="<?php echo $data['classes']['case_result_item']; ?>">
                                                <i class="<?php echo $data['classes']['case_result_icon']; ?>"></i>
                                                <?php echo htmlspecialchars($result); ?>
                                            </li>
                                        <?php endforeach; ?>
                                    </ul>
                                </div>

                                <a href="/case-studies/<?php echo htmlspecialchars($case['id']); ?>" class="<?php echo $data['classes']['case_link']; ?>">
                                    查看完整案例
                                    <i class="<?php echo $data['classes']['case_link_icon']; ?>"></i>
                                </a>
                            </div>
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>

            <div class="text_center">
                <a href="/case-studies" class="<?php echo $data['classes']['case_more_button']; ?>">
                    <?php echo htmlspecialchars($data['texts']['case_studies_more']); ?>
                    <i class="<?php echo $data['classes']['case_more_icon']; ?>"></i>
                </a>
            </div>
        </div>

        <!-- 设计服务定价 -->
        <div class="max_w_5xl mx-auto mb_20">
            <div class="text_center mb_16">
                <h2 class="<?php echo $data['classes']['section_title']; ?>">
                    <?php echo htmlspecialchars($data['texts']['pricing_title']); ?>
                </h2>
                <p class="<?php echo $data['classes']['section_subtitle']; ?> max_w_3xl mx-auto">
                    <?php echo htmlspecialchars($data['texts']['pricing_subtitle']); ?>
                </p>
            </div>

            <div class="<?php echo $data['classes']['pricing_grid']; ?>">
                <?php foreach ($data['pricing'] as $package): ?>
                    <div class="<?php echo $cardClass; ?> <?php echo $data['classes']['pricing_card']; ?> <?php echo $package['recommended'] ? $data['classes']['card_featured'] : ''; ?>">
                        <?php if ($package['recommended']): ?>
                            <div class="<?php echo $data['classes']['pricing_recommended_badge']; ?>">
                                推荐
                            </div>
                        <?php endif; ?>

                        <h3 class="<?php echo $data['classes']['card_title']; ?>"><?php echo htmlspecialchars($package['title']); ?></h3>
                        <p class="<?php echo $data['classes']['card_subtitle']; ?>"><?php echo htmlspecialchars($package['subtitle']); ?></p>

                        <div class="mb-6">
                            <span class="<?php echo $data['classes']['pricing_price']; ?>">¥<?php echo number_format($package['price']); ?></span>
                            <span class="<?php echo $data['classes']['pricing_period']; ?>"><?php echo htmlspecialchars($package['period']); ?></span>
                        </div>

                        <ul class="<?php echo $data['classes']['pricing_features']; ?>">
                            <?php foreach ($package['features'] as $feature): ?>
                                <li class="<?php echo $data['classes']['pricing_feature_item']; ?>">
                                    <i class="<?php echo $data['classes']['pricing_feature_icon']; ?>"></i>
                                    <span class="<?php echo $data['classes']['pricing_feature_text']; ?>"><?php echo htmlspecialchars($feature); ?></span>
                                </li>
                            <?php endforeach; ?>
                        </ul>

                        <a href="#design-form" class="<?php echo $data['classes']['pricing_button']; ?> <?php echo $package['recommended'] ? $data['classes']['pricing_button_recommended'] : $data['classes']['pricing_button_standard']; ?>">
                            <?php echo htmlspecialchars($package['button_text']); ?>
                        </a>
                    </div>
                <?php endforeach; ?>
            </div>

            <div class="<?php echo $data['classes']['pricing_note']; ?>">
                <p><?php echo $data['texts']['pricing_custom_note']; ?></p>
            </div>
        </div>

        <!-- 设计评估预约表单 -->
        <div id="design-form" class="<?php echo $data['classes']['cta_container']; ?>">
            <div class="<?php echo $data['classes']['cta_grid']; ?>">
                <!-- 表单信息 -->
                <div class="<?php echo $data['classes']['cta_info']; ?>">
                    <h2 class="<?php echo $data['classes']['cta_info_title']; ?>">
                        <?php echo htmlspecialchars($data['cta']['title']); ?>
                    </h2>
                    <p class="<?php echo $data['classes']['cta_info_subtitle']; ?>">
                        <?php echo htmlspecialchars($data['cta']['subtitle']); ?>
                    </p>

                    <div class="<?php echo $data['classes']['cta_features']; ?>">
                        <?php foreach ($data['cta']['features'] as $feature): ?>
                            <div class="<?php echo $data['classes']['cta_feature_item']; ?>">
                                <div class="<?php echo $data['classes']['cta_feature_icon']; ?>">
                                    <i class="fa <?php echo htmlspecialchars($feature['icon']); ?>"></i>
                                </div>
                                <div class="<?php echo $data['classes']['cta_feature_content']; ?>">
                                    <h4 class="<?php echo $data['classes']['cta_feature_title']; ?>"><?php echo htmlspecialchars($feature['title']); ?></h4>
                                    <p class="<?php echo $data['classes']['cta_feature_desc']; ?>"><?php echo htmlspecialchars($feature['description']); ?></p>
                                </div>
                            </div>
                        <?php endforeach; ?>
                    </div>
                </div>

                <!-- 表单 -->
                <div class="<?php echo $data['classes']['cta_form_container']; ?>">
                    <form
                        action="<?php echo htmlspecialchars($data['cta']['form_action']); ?>"
                        method="post"
                        class="<?php echo $data['classes']['cta_form']; ?>"
                        id="<?php echo htmlspecialchars($data['cta']['form_id']); ?>">
                        <?php foreach ($data['cta']['form_elements'] as $element): ?>
                            <div class="<?php echo $data['classes']['form_group']; ?>">
                                <label for="<?php echo htmlspecialchars($element['name']); ?>" class="<?php echo $data['classes']['form_label']; ?>">
                                    <?php echo htmlspecialchars($element['label']); ?>
                                    <?php if ($element['required']): ?>
                                        <span class="<?php echo $data['classes']['form_required']; ?>"><?php echo htmlspecialchars($data['texts']['form_required_mark']); ?></span>
                                    <?php endif; ?>
                                </label>

                                <?php if ($element['type'] === 'textarea'): ?>
                                    <textarea
                                        id="<?php echo htmlspecialchars($element['name']); ?>"
                                        name="<?php echo htmlspecialchars($element['name']); ?>"
                                        rows="<?php echo $element['rows'] ?? 4; ?>"
                                        <?php echo $element['required'] ? 'required' : ''; ?>
                                        class="<?php echo $data['classes']['form_textarea']; ?>"
                                        placeholder="<?php echo htmlspecialchars($element['placeholder']); ?>"></textarea>

                                <?php elseif ($element['type'] === 'select'): ?>
                                    <select
                                        id="<?php echo htmlspecialchars($element['name']); ?>"
                                        name="<?php echo htmlspecialchars($element['name']); ?>"
                                        <?php echo $element['required'] ? 'required' : ''; ?>
                                        class="<?php echo $data['classes']['form_select']; ?>">
                                        <?php foreach ($element['options'] as $value => $label): ?>
                                            <option value="<?php echo htmlspecialchars($value); ?>"><?php echo htmlspecialchars($label); ?></option>
                                        <?php endforeach; ?>
                                    </select>

                                <?php else: ?>
                                    <input
                                        type="<?php echo htmlspecialchars($element['type']); ?>"
                                        id="<?php echo htmlspecialchars($element['name']); ?>"
                                        name="<?php echo htmlspecialchars($element['name']); ?>"
                                        <?php echo $element['required'] ? 'required' : ''; ?>
                                        class="<?php echo $data['classes']['form_control']; ?>"
                                        placeholder="<?php echo htmlspecialchars($element['placeholder']); ?>">
                                <?php endif; ?>
                            </div>
                        <?php endforeach; ?>

                        <div class="pt-2">
                            <button
                                type="submit"
                                class="<?php echo $data['classes']['form_submit']; ?>">
                                <span class="<?php echo $data['classes']['form_submit_text']; ?>"><?php echo htmlspecialchars($data['cta']['button_text']); ?></span>
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- UI/UX设计服务交互脚本 -->
<script>
    document.addEventListener('DOMContentLoaded', function() {
        // 从PHP配置动态获取参数
        const config = {
            formId: <?php echo json_encode($data['cta']['form_id']); ?>,
            formSubmitSuccess: <?php echo json_encode($data['texts']['form_submit_success']); ?>
        };

        // 服务卡片动画
        const serviceCards = document.querySelectorAll('[data-service-card]');
        const observer = new IntersectionObserver((entries) => {
            entries.forEach(entry => {
                if (entry.isIntersecting) {
                    entry.target.style.opacity = '1';
                    entry.target.style.transform = 'translateY(0)';
                    observer.unobserve(entry.target);
                }
            });
        }, {
            threshold: 0.1
        });

        serviceCards.forEach((card, index) => {
            card.style.opacity = '0';
            card.style.transform = 'translateY(30px)';
            card.style.transition = `opacity 0.5s ease ${index * 0.1}s, transform 0.5s ease ${index * 0.1}s`;
            observer.observe(card);
        });

        // 流程步骤动画
        const processSteps = document.querySelectorAll('.<?php echo $data['classes']['process_step']; ?>');
        const processObserver = new IntersectionObserver((entries) => {
            entries.forEach(entry => {
                if (entry.isIntersecting) {
                    entry.target.style.opacity = '1';
                    entry.target.style.transform = 'translateY(0)';
                    processObserver.unobserve(entry.target);
                }
            });
        }, {
            threshold: 0.2
        });

        processSteps.forEach((step, index) => {
            step.style.opacity = '0';
            step.style.transform = 'translateY(20px)';
            step.style.transition = `opacity 0.5s ease ${index * 0.15}s, transform 0.5s ease ${index * 0.15}s`;
            processObserver.observe(step);
        });

        // 表单提交处理
        const designForm = document.getElementById(config.formId);
        if (designForm) {
            designForm.addEventListener('submit', function(e) {
                e.preventDefault();

                // 在实际项目中，这里会有AJAX提交表单的逻辑
                const submitButton = this.querySelector('button[type="submit"]');
                const originalText = submitButton.innerHTML;

                // 显示加载状态
                submitButton.disabled = true;
                submitButton.innerHTML = `<i class="<?php echo $data['classes']['form_submit_loading']; ?>"></i> 提交中...`;

                // 模拟表单提交
                setTimeout(() => {
                    // 显示成功消息
                    alert(config.formSubmitSuccess);

                    // 重置表单和按钮
                    this.reset();
                    submitButton.disabled = false;
                    submitButton.innerHTML = originalText;
                }, 1500);
            });
        }

        // 平滑滚动
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function(e) {
                e.preventDefault();

                const targetId = this.getAttribute('href');
                const targetElement = document.querySelector(targetId);

                if (targetElement) {
                    targetElement.scrollIntoView({
                        behavior: 'smooth',
                        block: 'start'
                    });
                }
            });
        });
    });
</script>